package edu.ncsu.monopoly.logic.entities;

import edu.ncsu.monopoly.logic.GameMaster;
import edu.ncsu.monopoly.logic.cells.Cell;


public class MovePlayerCard extends Card {
    private String destination;

    public MovePlayerCard(String destination) {
        this.destination = destination;
    }

    public void applyAction() {
    	Player currentPlayer = GameMaster.instance().getCurrentPlayer();
        Cell currentPosition = currentPlayer.getPosition();
        int distance = GameMaster.instance().getGameBoard().getDistanceBetweenCells(currentPosition.getName(), destination);

        GameMaster.instance().movePlayer(currentPlayer, distance);
    }

    public String getLabel() {
        return "Go to " + destination;
    }

}
